<!DOCTYPE html>
<html>
	<head>
		<script type="text/javascript" src="../js/wap_meta.js" ></script>
		<meta charset="utf-8" />
		<title></title>
		<script type="text/javascript" src="../js/jquery-2.1.1.js" ></script>
		<link rel="stylesheet" href="../css/base.css" />
		<script src="../js/jquery.cookie.js"></script>
		<script type="text/javascript" src="../js/link.js" ></script>
	</head>
	<style>
		* {
			padding: 0;
			margin: 0;
			font-family: "微软雅黑";
		}
		
		body {
			background: #f0f0f0;
		}
		.title p{
			width: 750px;
			text-align: center;
			font-size: 34px;
			color: #004591;
			padding-top: 26px;
		}
		.close{
			position: absolute;
			top: 30px;
			left: 680px;
		}
		.ad{
			position: absolute;
			top: 100px;
			height: 300px;
			width: 750px;
		}
		.content1{
			position: absolute;
			top: 130px;
			padding-bottom: 100px;
		}
		.icon1{
			position: absolute;
			top: 360px;
		}
		.comform{
			position: absolute;
			left: 30px;
			top: 900px;
			padding-bottom: 100px;
		}
		.content2{
			position: absolute;
			top: 130px;
			padding-bottom: 100px;
		}
		.icon2{
			position: absolute;
			top: 310px;
		}
		.infos{
			position: absolute;
			top: 390px;
		}
		.infos p{
			color: #e70000;
			font-size: 32px;
			width: 750px;
			padding-left: 30px;
			line-height: 50px;
		}
		.instructions{
			position: absolute;
			background: #999;
			top: 620px;
			width: 750px;
			padding-top: 1px;
			padding-bottom: 1px;
			margin-bottom: 150px;
		}
		.instruction{
			background: #fff;
		}
		.instructionTitle{
			width: 690px;
			color: #333333;
			font-size: 36px;
			padding-top: 20px;
			padding-left: 30px;
			padding-right: 30px;
			padding-bottom: 10px;
		}
		.instruction p{
			width: 690px;
			padding-bottom: 40px;
			padding-left: 30px;
			padding-right: 30px;
			color: #333333;
			font-size: 32px;
			line-height: 46px;
		}
	</style>
	<body>
		<div class="title">
			<p>结果详情</p>
			<img class="close" src="../img/activate/close.png" />
		</div>
		<img class="ad" src="../img/0/ad.jpg" />
		<div class="content1">
			<img class="icon1" src="../img/activate/icon1.png" />
			<img class="comform" src="../img/activate/complete.png" />
		</div>
		<div class="content2">
			<img class="icon2" src="../img/activate/icon2.png" />
			<div class="infos">
				<p>保险保单号：564485512</p>
				<p>保险到期日：2018-05-16</p>
				<p>保险保单号：564485512</p>
				<p>保险保单号：564485512</p>
			</div>
			<div class="instructions">
				<div class="instruction">
					<div class="instructionTitle">保障详情说明</div>
					<p>保险单内容说明投保单经过核保人的最终审核通过，确认客户已经交足保费并将所有下发的函件完全回销后，公司将会对该张投保单做承保操作，并打印下发保险单。</p>
				</div>
			</div>
		</div>
		<script>
			function getQueryString(name) {
				var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
				var r = window.location.search.substr(1).match(reg);
				if(r != null) {
					return unescape(r[2]);
				}
				return null;
			}
			
			$(".content1").hide();
			$(".content2").hide();
			
			var obj = new Object;
			obj.channelCode = getQueryString("channelCode");
			obj.idNo = getQueryString("idNo");
//			obj.realName = getQueryString("realName");
//			obj.mobile = getQueryString("mobile");
			obj.groupCode = getQueryString("groupCode");
			obj.volunteerCode = getQueryString("volunteerCode");
//			obj.businessCode = getQueryString("businessCode");
//			obj.passportNo = getQueryString("passportNo");
			
			$.ajax({
				url: linkObj.callBack,
//				url: "https://test.dakaqi.cn:2443/pingan/openFinshedCallBack",
				type: "post",
		        dataType : 'json',  
				data: JSON.stringify(obj),
    			contentType: "application/json",
				success: function(data) {
					if(data.success == true) {
						if(data.obj.page == "thanks"){
							$(".content1").show();
						}else{
							$(".content2").show();
							
							loadinsurance(data.obj.insuranceNo);
						}
					} else {
						alert(data.msg)
					}
				}
			});
			
			$(".close").click(function(){
				window.close();
			})
			$(".comform").click(function(){
				window.close();
			})
			
			function getQueryString(name) {
				var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
				var r = window.location.search.substr(1).match(reg);
				if(r != null) {
					return unescape(r[2]);
				}
				return null;
			}
			
			function loadinsurance(code){
				$.ajax({
					url: linkObj.getInsurance,
					type: "get",
					data: {
						"channelCode":getQueryString("channelCode"),
						"idNo":getQueryString("idNo"),
						"insuranceNo":code
					},
					success: function(data) {
						if(data.success == true) {
							$(".infos").empty();
							$(".ad").attr("src",data.obj.volunteerInsurace.channelAdsImg);
							var str = "";
							str += "<p>保险保单号："+ data.obj.volunteerInsurace.insuranceNo +"</p>";
							str += "<p>保险到期日："+ data.obj.volunteerInsurace.periodEnd +"</p>";
							str += "<p>理赔账户："+ data.obj.volunteerInsurace.bankNum +"</p>";
							str += "<p>鸣谢单位：上海悠活科技网络有限公司</p>";
							
							$(".infos").append(str);
						} else {
							alert(data.msg)
						}
					}
				});
			}
		</script>
	</body>
</html>